package com.htgraph.renderer;

import com.mxgraph.model.mxCell;
import com.mxgraph.model.mxGraphModel;
import com.mxgraph.model.mxIGraphModel;
import com.ht.aems.util.RtDataBuffer;
import com.htgraph.util.CellFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 *
 * @author Wang jiaxiang
 *         Date: 2010-7-16
 */
public class IeeeDataRenderer extends CellRenderUpdator {

    public IeeeDataRenderer(mxIGraphModel model) {
        super(model);
    }

    public void updateCells(RtDataBuffer buffer) {
        Map<String, Object> cells = ((mxGraphModel) model).getCells();
        Map<mxCell, mxCell[]> cell2Paint = new HashMap<mxCell, mxCell[]>(cells.size());
        mxCell cell;
        for (Object obj : cells.values()) {
            cell = (mxCell) obj;
            cell2Paint.put(cell, new mxCell[3]);
        }
        CellFactory.fillCells(cell2Paint);
    }
}
